package com.flyme.module.file.client.api;


import com.flyme.common.core.model.ResultBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

/**
 * @author zyf
 */
public interface SysFileRemoteService{

    /**
     * 上传文件
     * @param file 文件
     */
    @PostMapping("/file/upload")
    ResultBody<Map<String,Object>> upload(@RequestParam("file") MultipartFile file, HttpServletRequest request);

    /**
     * 查看文件
     */
    @GetMapping(value="/file/view/{id}")
    void view(@PathVariable String id,HttpServletResponse response) throws IOException;

}
